package cn.tedu._05interceptor.base.config;

import cn.tedu._05interceptor.base.interceptor.MyInterceptors;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    /*
    * 拦截策略
    * 1、拦截所有请求，暴力拦截
    * */
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptors())
                .addPathPatterns("/v1/**");
    }

}
